<template>
  <div>
    {{son1.apple1}}
    <hr />
    {{son2.apple2}}
    <hr />
    {{son3.apple3}}
    <hr />
    {{son4.apple4}}
  </div>
</template>

<script>
import sonComponets, { son4 } from "./sonComponents";
let son1 = {
  apple1: "苹果1"
};
const data = {
  son1,
  son2: {},
  son3: {},
  son4: {}
};
function myVueLearn(k, f) {
  if (f instanceof Function) {
    this[k] = f();
  } else if (f instanceof Object) {
    this[k] = f;
  }
}
export default {
  data() {
    return data;
  },
  mounted() {
    myVueLearn.bind(this)("son2", sonComponets.data);
    myVueLearn.bind(this)("son3", sonComponets.computed.Apple3);
    myVueLearn.bind(this)("son4", son4);
  }
};
</script>

<style>
</style>